package com.xuecheng.manage_cms.service.impl;

import com.xuecheng.framework.domain.cms.CmsConfig;
import com.xuecheng.manage_cms.dao.CmsConfigRepository;
import com.xuecheng.manage_cms.service.CmsConfigService;
import org.springframework.stereotype.Service;

import javax.annotation.Resource;
import java.util.Optional;

@Service
public class CmsConfigServiceImpl implements CmsConfigService {
    @Resource
    private CmsConfigRepository cmsConfigRepository;
    /**
     * 根据CmsConfig的id查询一个数据模型
     *
     * @param id CmsConfig的id
     * @return 查询出的数据模型
     */
    @Override
    public CmsConfig getConfigById(String id) {
        Optional<CmsConfig> optional = cmsConfigRepository.findById(id);
        return optional.orElse(null);
    }
}
